/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package config;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 *
 * @author Linhta
 */
public class IBshop {
    
    //levelCote -> object
     public static class Cote
    {
         public long requireGold;
         public long requireCoin;
         public int requireLevel;
    }
    
    //levelAqua -> Object 
    public static class Aquarium
    {
         public long requireGold;
          public long requireCoin;
          public int requireLevel;
    }
    
    //levelBox -> object
    public static class BoxEggs
    {
         public long requireGold;
          public long requireCoin;
         public int requireLevel;
    }
    
   //type -> object
    public static class Penguin
    {
         public int requireLevel;
        public int requireCoin;
        public int requireGold;
    }
    
    //type -> object
    public static class Egg
    {
        public int requireLevel;
        public int requireCoin;
        public int requireGold;
    }
    
   
    
     public static Map<String,Object> configObj(Map<String,Cote> cotes, Map<String,Aquarium> aquas,Map<String,BoxEggs> boxs, Map<String,Penguin> pegs,Map<String,Egg> eggs)
     {
         Map<String, Object> config = new HashMap<String, Object>();
         
         Map<String, Object> oCotes = new HashMap<String, Object>();
         for (Map.Entry<String, Cote> entry : cotes.entrySet()) {
              String string = entry.getKey();
             Cote object = entry.getValue();
             
             Map<String, Object> cote = new HashMap<String, Object>();
             cote.put("requireCoin", object.requireCoin);
             cote.put("requireGold", object.requireGold);
             cote.put("requireLevel", object.requireLevel);
            
             oCotes.put(string, cote);
         }
         
         
         Map<String, Object> oAquas = new HashMap<String, Object>();
         for (Map.Entry<String, Aquarium> entry : aquas.entrySet()) {
              String string = entry.getKey();
             Aquarium object = entry.getValue();
             
             Map<String, Object> aqua = new HashMap<String, Object>();
             aqua.put("requireCoin", object.requireCoin);
             aqua.put("requireGold", object.requireGold);
             aqua.put("requireLevel", object.requireLevel);
            
             oAquas.put(string, aqua);
         }
         
         
         Map<String, Object> oBoxs = new HashMap<String, Object>();
         for (Map.Entry<String, BoxEggs> entry : boxs.entrySet()) {
              String string = entry.getKey();
             BoxEggs object = entry.getValue();
             
             Map<String, Object> oPegs = new HashMap<String, Object>();
             oPegs.put("requireCoin", object.requireCoin);
             oPegs.put("requireGold", object.requireGold);
             oPegs.put("requireLevel", object.requireLevel);
            
             oBoxs.put(string, oPegs);
         }
         
         
         Map<String, Object> oPegs = new HashMap<String, Object>();
         for (Map.Entry<String, Penguin> entry : pegs.entrySet()) {
              String string = entry.getKey();
             Penguin object = entry.getValue();
             
             Map<String, Object> peg = new HashMap<String, Object>();
             peg.put("requireCoin", object.requireCoin);
             peg.put("requireGold", object.requireGold);
             peg.put("requireLevel", object.requireLevel);
            
             oPegs.put(string, peg);
         }
         
         
         Map<String, Object> oEggs = new HashMap<String, Object>();
         for (Map.Entry<String, Egg> entry : eggs.entrySet()) {
              String string = entry.getKey();
             Egg object = entry.getValue();
             
             Map<String, Object> egg = new HashMap<String, Object>();
             egg.put("requireCoin", object.requireCoin);
             egg.put("requireGold", object.requireGold);
             egg.put("requireLevel", object.requireLevel);
            
             oEggs.put(string, egg);
         }
         
         config.put("cotes", oCotes);
         config.put("aquariums", oAquas);
          config.put("boxs", oBoxs);
           config.put("eggs", oEggs);
            config.put("penguins", oPegs);
         
         
         return config;
     }
    
}
